home *** CD-ROM | disk | FTP | other *** search
/ Aminet 34 / Aminet 34 (2000)(Schatztruhe)[!][Dec 1999].iso / Aminet / util / libs / DateLib.lha / DateLib / Lib-Install < prev   
Encoding:
Text File  |  1999-10-06  |  58.6 KB  |  2,067 lines

  1. ;
  2. ; Installer script for Amiga shared libraries
  3. ;
  4. ; Copyright © 1997-1999 Dipl.-Inform. Kai Hofmann
  5. ; All rights reserved!
  6. ; Released as Giftware without any explicit or implicit warranty!
  7. ;
  8. ; EMail: hofmann@hofmann-int.de
  9. ; WWW  : http://www.hofmann-int.de/
  10. ;
  11. ; $VER: Lib-Install 43.3 (06.10.99)
  12. ;
  13. ; -----------------------------------------------------------------------------
  14. ; WrapGuide is copyright © 1994-1995 Udo Schuermann
  15. ; -----------------------------------------------------------------------------
  16. ;
  17. ; Archive structure:
  18. ;
  19. ; <name>Lib/<name>Lib.pi                    (recommended)
  20. ; <name>Lib/<name>Lib.readme
  21. ; <name>Lib/<name>Lib.readme.info
  22. ; <name>Lib/Lib-Install
  23. ; <name>Lib/Lib-Install.info
  24. ; <name>Lib/Install/English.info                (optional)
  25. ; <name>Lib/Install/...                     (optional)
  26. ;
  27. ; <name>Lib/Libs/<name>.library                 (optional)
  28. ; <name>Lib/Libs/<name>000.library                (optional)
  29. ; <name>Lib/Libs/<name>010.library                (optional)
  30. ; <name>Lib/Libs/<name>020.library                (optional)
  31. ; <name>Lib/Libs/<name>020f.library                (optional)
  32. ; <name>Lib/Libs/<name>030.library                (optional)
  33. ; <name>Lib/Libs/<name>030f.library                (optional)
  34. ; <name>Lib/Libs/<name>040.library                (optional)
  35. ; <name>Lib/Libs/<name>040f.library                (optional)
  36. ; <name>Lib/Libs/<name>060.library                (optional)
  37. ; <name>Lib/Locale/Catalogs/.../<name>_lib.catalog        (optional)
  38. ; <name>Lib/Developer/C/Include/Libraries/<name>.h
  39. ; <name>Lib/Developer/C/Include/Proto/<name>.h
  40. ; <name>Lib/Developer/C/Include/CLib/<name>_protos.h
  41. ; <name>Lib/Developer/C/Include/Pragmas/<name>_pragmas.h
  42. ; <name>Lib/Developer/Amiga-E/Modules/<name>_pragmas.m        (optional)
  43. ; <name>Lib/Developer/Amiga-E/Modules/Libraries/<name>.e    (optional)
  44. ; <name>Lib/Developer/Modula/Defs/<name>D.def            (optional)
  45. ; <name>Lib/Developer/Modula/Defs/<name>L.def            (optional)
  46. ; <name>Lib/Developer/Oberon/Interfaces/<name>.mod        (optional)
  47. ; <name>Lib/Developer/Assembler/Include/Libraries/<name>.i    (optional)
  48. ; <name>Lib/Developer/Assembler/Include/lvo/<name>.i        (optional)
  49. ; <name>Lib/Developer/Rexx/Include/<name>.rexx            (optional)
  50. ;
  51. ; -----------------------------------------------------------------------------
  52. ; TODO:
  53. ;
  54. ; <name>Lib/Developer/Autodocs/<name>.doc
  55. ; <name>Lib/Developer/BB2/Include/Libraries/<name>.asc        (optional)
  56. ; <name>Lib/Developer/BB2/blitzlibs/amigalibs/<name>.library1    (optional)
  57. ; <name>Lib/Developer/BB2/Examples/<name>Lib-Demo.asc        (optional)
  58. ; <name>Lib/Developer/Cluster/txt/<name>.def            (optional)
  59. ; <name>Lib/Developer/Cluster/txt/<name>.mod            (optional)
  60. ; <name>Lib/Developer/Cluster/txt/<name>LibDemo.mod        (optional)
  61. ; <name>Lib/Developer/Rexx/Examples/<name>Lib-Demo.rexx     (optional)
  62. ; <name>Lib/Developer/Oberon/Examples/<name>LibDemo.mod     (optional)
  63. ; <name>Lib/Developer/Modula/Demo/<name>LibDemo.mod        (optional)
  64. ; <name>Lib/Developer/Amiga-E/Examples/<name>Lib-Demo.e     (optional)
  65. ; <name>Lib/Developer/Assembler/Examples/<name>Lib-Demo.s    (optional)
  66. ; <name>Lib/Developer/C/Examples/<name>Lib-Demo.c        (optional)
  67. ; <name>Lib/Developer/Source/<name>Lib/...            (optional)
  68. ; <name>Lib/Docs/english/<name>Lib.guide
  69. ; <name>Lib/Docs/english/<name>Lib.guide.info
  70. ; <name>Lib/Docs/english/<name>Lib.doc                (optional)
  71. ; <name>Lib/Docs/english/<name>Lib.doc.info            (optional)
  72. ; <name>Lib/Docs/english/<name>_home.html            (optional)
  73. ; <name>Lib/Docs/english/<name>_home.html.info            (optional)
  74. ; <name>Lib/Docs/english/<name>_<pagename>.html         (optional)
  75. ; <name>Lib/Docs/english/<name>_<pagename>.html.info        (optional)
  76. ; <name>Lib/Docs/......./<name>Lib.guide            (optional)
  77. ; <name>Lib/Docs/......./<name>Lib.guide.info            (optional)
  78. ; <name>Lib/Docs/......./<name>Lib.doc                (optional)
  79. ; <name>Lib/Docs/......./<name>Lib.doc.info            (optional)
  80. ; <name>Lib/Docs/......./<name>_home.html            (optional)
  81. ; <name>Lib/Docs/......./<name>_home.html.info            (optional)
  82. ; <name>Lib/Docs/......./<name>_<pagename>.html         (optional)
  83. ; <name>Lib/Docs/......./<name>_<pagename>.html.info        (optional)
  84. ; <name>Lib/Demos/<name>Lib-Demo                (optional)
  85. ; <name>Lib/Demos/<name>Lib-Demo.info                (optional)
  86. ; <name>Lib/C/WrapGuide                     (optional)
  87. ;
  88. ; Support for more languages
  89. ; C++
  90. ; Support for more assemblers (OMA is the only one for the moment)
  91. ; Preferences
  92. ;
  93. ; --- Custom initialisation ---------------------------------------------------
  94.  
  95.  ; Copyright
  96.  (set #copyright "Copyright © 1994-1999 Dipl.-Inform. Kai Hofmann")
  97.  
  98.  ; Minimum OS version required for installation
  99.  (set #min_os_version 33)
  100.  (set #min_os_revision 0)
  101.  
  102.  ; Bultin language
  103.  ; Bit    0 = English
  104.  ; Bit    1 = German
  105.  ; Bit    2 = French
  106.  ; Bit    3 = Spanish
  107.  ; Bit    4 = Portuguese (European)
  108.  ; Bit    5 = Danish
  109.  ; Bit    6 = Italian
  110.  ; Bit    7 = Dutch
  111.  ; Bit    8 = Norwegian
  112.  ; Bit    9 = Swedish
  113.  ; Bit 10 = Polish
  114.  ; Bit 11 = Finnish
  115.  ; Bit 12 = Hungarian
  116.  ; Bit 13 = Greek
  117.  ; Bit 14 = Esperanto
  118.  ; Bit 15 = Turkish
  119.  ; Bit 16 = Latin
  120.  ; Bit 17 = Russian
  121.  ; Bit 18 = Czech
  122.  ; Bit 19 = Catalonian
  123.  ; Bit 20 = Croatian
  124.  ; Bit 21 = Serbian
  125.  ; Bit 22 = Slovak
  126.  ; Bit 23 = Slovenian
  127.  ; Bit 24 = Portuguese (Brazilian)
  128.  
  129.  (set #language %0001011111111111111111111) ; LANGUAGE
  130.  
  131. ; --- Custom installation procedures ------------------------------------------
  132.  
  133.  (procedure P_CustomExists
  134.   ; Params:
  135.   ;
  136.   ; Results:
  137.   ;
  138.   ; Used Vars:
  139.   ;
  140.  
  141.  )
  142.  
  143.  (procedure P_CustomInstall
  144.   ; Params:
  145.   ;
  146.   ; Results:
  147.   ;
  148.   ; Used Vars:
  149.   ;
  150.  
  151.  )
  152.  
  153.  (procedure P_CustomUninstall
  154.   ; Params:
  155.   ;
  156.   ; Results:
  157.   ;
  158.   ; Used Vars:
  159.   ;
  160.  
  161.  )
  162.  
  163. ; -----------------------------------------------------------------------------
  164. ; --- Do not change anything below this line ----------------------------------
  165. ; -----------------------------------------------------------------------------
  166.  
  167.  (set @default-dest "Libs:")
  168.  
  169.  (if (= @installer-ng-version 0)
  170.    (if (= @installer-version 0)
  171.      (
  172.       ; old Installer
  173.       (set #prop "")
  174.      )
  175.      (
  176.       ; new Installer
  177.       (set #prop "\x1b[2p")
  178.      )
  179.    )
  180.    (
  181.     ; InstallerNG
  182.     (set #prop "\x1b[2p")
  183.    )
  184.  )
  185.  
  186. ; --- Installer script strings ------------------------------------------------
  187.  
  188.  (set #i 0)
  189.  (while (<> @language (select #i "deutsch" @language)) ; LANGUAGE
  190.    (set #i (+ #i 1))
  191.  )
  192.  (if (= #i 1) ; LANGUAGE
  193.    (set #language "english")
  194.    (set #language @language)
  195.  )
  196.  
  197.  (set #i 0)
  198.  (set #language_default %1000000000000000000000000) ; LANGUAGE
  199.  (while (<> #language (select #i "português-brasil" "slovensko" "Slovak" "srpski" "Croatian" "catalonian" "ÃeÓtina" "russian" "latina" "türkçe" "esperanto" "greek" "magyar" "suomi" "polski" "svenska" "norsk" "nederlands" "italiano" "dansk" "português" "español" "français" "deutsch" #language)) ; LANGUAGE
  200.    (
  201.     (set #language_default (shiftright #language_default 1))
  202.     (set #i (+ #i 1))
  203.    )
  204.  )
  205.  (select #i ; LANGUAGE
  206.    ( ; Portuguese (Brazilian)
  207.     (complete 0)
  208.    )
  209.    ( ; Slovenian
  210.     (complete 0)
  211.    )
  212.    ( ; Slovak
  213.     (complete 0)
  214.    )
  215.    ( ; Serbian
  216.     (complete 0)
  217.    )
  218.    ( ; Croatian
  219.     (complete 0)
  220.    )
  221.    ( ; Catalonian
  222.     (complete 0)
  223.    )
  224.    ( ; Czech
  225.     (complete 0)
  226.    )
  227.    ( ; Russian
  228.     (complete 0)
  229.    )
  230.    ( ; Latina
  231.     (complete 0)
  232.    )
  233.    ( ; Türkçe
  234.     (complete 0)
  235.    )
  236.    ( ; Esperanto
  237.     (complete 0)
  238.    )
  239.    ( ; Greek
  240.     (complete 0)
  241.    )
  242.    ( ; Magyar
  243.     (complete 0)
  244.    )
  245.    ( ; Finnish
  246.     (complete 0)
  247.    )
  248.    ( ; Polish
  249.     (complete 0)
  250.    )
  251.    ( ; Swedish
  252.     (complete 0)
  253.    )
  254.    ( ; norsk
  255.     (complete 0)
  256.    )
  257.    ( ; nederlands
  258.     (complete 0)
  259.    )
  260.    ( ; italiano
  261.     (complete 0)
  262.    )
  263.    ( ; dansk
  264.     (complete 0)
  265.    )
  266.    ( ; português (European)
  267.     (complete 0)
  268.    )
  269.    ( ; español
  270.     (complete 0)
  271.    )
  272.    ( ; français
  273.     (complete 0)
  274.    )
  275.    ( ; deutsch
  276.     (if (= @installer-version 0)
  277.       (
  278.        (set #help_askoptions "Mit einem Installer der älter als Version 42.6 ist, kann es passieren, daß Checkbox-Knöpfe ohne Labels zu sehen sind. Das Setzen dieser Knöpfe wird ignoriert.\n\n")
  279.        (set #help_askchoice  "Mit einem Installer der älter als Version 42.6 ist, kann es passieren, daß Radio-Knöpfe ohne Labels zu sehen sind. Das Setzen dieser Knöpfe entspricht der nächst kleineren Auswahl.\n\n")
  280.       )
  281.     )
  282.     (set #unknown          "unbekannt")
  283.     (set #choice_english      "Englisch")
  284.     (set #choice_german       "Deutsch")
  285.     (set #choice_french       "Französisch")
  286.     (set #choice_spanish      "Spanisch")
  287.     (set #choice_portuguese   "Portugiesisch")
  288.     (set #choice_danish       "Dänisch")
  289.     (set #choice_italian      "Italienisch")
  290.     (set #choice_dutch          "Niederländisch")
  291.     (set #choice_norwegian    "Norwegisch")
  292.     (set #choice_swedish      "Schwedisch")
  293.     (set #choice_polish       "Polnisch")
  294.     (set #choice_finnish      "Finnisch")
  295.     (set #choice_hungarian    "Ungarisch")
  296.     (set #choice_turkish      "Türkisch")
  297.     (set #choice_greek          "Griechisch")
  298.     (set #choice_latin          "Latein")
  299.     (set #choice_esperanto    "Esperanto")
  300.     (set #choice_russian      "Russisch")
  301.     (set #choice_czech          "Tschechisch")
  302.     (set #choice_catalonian   "Katalanisch")
  303.     (set #choice_croatian     "Kroatisch")
  304.     (set #choice_serbian      "Serbisch")
  305.     (set #choice_slovak       "Slowakisch")
  306.     (set #choice_slovenian    "Slawisch")
  307.     (set #choice_portuguesebr "Portugiesisch (Br)") ; LANGUAGE
  308.  
  309.     (set #choice_catalogs   "Kataloge")
  310.     (set #choice_docs        "Dokumentation")
  311.     (set #choice_developer  "Entwickler-Material")
  312.     (set #choice_source     "Quellcode")
  313.     (set #choice_images     "Bilder")
  314.     (set #choice_install    "Installieren")
  315.     (set #choice_update     "Updaten")
  316.     (set #choice_uninstall  "Deinstallieren")
  317.     (set #prompt_askcpufpu (cat "Bitte wählen Sie die CPU/FPU Konfiguration, für die die " @app-name ".library installiert werden soll."))
  318.     (set #prompt_info (cat "\nWillkommen zur " @app-name ".library\n" #copyright "\n\n"))
  319.     (set #prompt_install_uninstall (cat #prompt_info "Wollen Sie die Library installieren oder deinstallieren?"))
  320.     (set #abort_nocpu (cat "Die " @app-name ".library kann leider nicht installiert werden, da Ihre CPU-Konfiguration nicht unterstützt wird.\n"))
  321.     (set #prompt_uninstall_parts "Welche Teile wollen Sie deinstallieren?\n")
  322.     (set #prompt_uninstall_all (cat "Wollen Sie alles was mit der " @app-name ".library zu tun hat deinstallieren?"))
  323.     (set #help_uninstall_all "Wenn Sie nicht alles deinstallieren wollen, werden Sie gefragt welche Teile deinstalliert werden sollen.")
  324.     (set #abort_oldversion (cat "Der Installer hat die bereits installierte Version %ld.%ld von der " @app-name ".library gefunden.\n\n"
  325.                 "Wenn Sie die ältere Version %ld.%ld wieder installieren wollen, deinstallieren Sie die neuere Version bitte zuerst."
  326.                )
  327.     )
  328.     (set #prompt_update (cat "Welche Teile wollen Sie zur " @app-name ".library Installation hinzufügen?"))
  329.     (set #help_install_demo (cat "Die Demo ist ein kleines Programm, welches die Benutzung der " @app-name ".library zeigt."))
  330.     (set #help_install_source (cat "Der Quellcode der " @app-name ".library kann als Beispiel benutzt werden, oder aber um eigene (korrigierte) Binärfiles zu erzeugen.\nSeien Sie vorsichtig - der Quellcode kann in einer beliebigen Sprache vorliegen!"))
  331.     (set #prompt_copy "Wollen Sie die folgende(n) Datei(en) kopieren?")
  332.     (set #prompt_makedir "Das folgende Verzeichnis wurde nicht gefunden, deshalb muß es erzeugt werden:")
  333.     (set #exit_uninstall_finished (cat "Deinstallation abgeschlossen!\n"
  334.                        '"'
  335.                        @app-name
  336.                        '"'
  337.                        " wurde aus Ihrer Schublade (oder Partition) "
  338.                        '"'
  339.                        @default-dest
  340.                        '"'
  341.                        " entfernt."
  342.                   )
  343.     )
  344.     (set #button_abort "Deinstallation abbrechen")
  345. ; ---
  346.     (set #abort_oldos  (cat "Um die " @app-name ".library zu installieren wird mindestens OS %s benötigt.\n\n"
  347.                 "Der Installer konnte aber nur OS %s finden.\n"
  348.                )
  349.     )
  350.     (set #prompt_install_demo    "Wollen Sie die mitgelieferte Demo installieren?")
  351.     (set #prompt_install_source "Wollen Sie den Quellcode installieren?")
  352.  
  353.     (set #welcome_install   (cat "Willkommen zum Library Installations-Werkzeug.\n"
  354.                  "Bitte geben Sie an, wie die Installation geschehen soll (basierend auf Ihrem Wissen über den Amiga Computer)."
  355.                 )
  356.     )
  357.     (set #welcome_uninstall (cat "Willkommen zum Library deinstallations Werkzeug.\n"
  358.                  "Bitte geben Sie an, wie die Deinstallation geschehen soll (basierend auf Ihrem Wissen über den Amiga Computer)."
  359.                 )
  360.     )
  361.  
  362.     (set #prompt_install_plangs   "Unterstützung für welche Programmiersprache wollen Sie installieren?")
  363.     (set #prompt_uninstall_plangs "Unterstützung für welche Programmiersprache wollen Sie deinstallieren?")
  364.  
  365.     (set #prompt_install_catalogs    (cat "Welche Kataloge für die " @app-name ".library wollen Sie installieren?"))
  366.     (set #prompt_uninstall_catalogs (cat "Welche Katalog von der " @app-name ".library wollen Sie deinstallieren?"))
  367.  
  368.     (set #prompt_install_docs    "Welche Art von Dokumenten wollen Sie installieren?")
  369.     (set #prompt_uninstall_docs "Welche Art von Dokumenten wollen Sie deinstallieren?")
  370.  
  371.     (set #prompt_install_asciidocs   "Für welche Sprachen wollen Sie die ASCII Dokumentation installieren?")
  372.     (set #prompt_uninstall_asciidocs "Für welche Sprachen wollen Sie die ASCII Dokumentation deinstallieren?")
  373.     (set #prompt_install_agdocs      "Für welche Sprachen wollen Sie die AmigaGuide® Dokumentation installieren?")
  374.     (set #prompt_uninstall_agdocs    "Für welche Sprachen wollen Sie die AmigaGuide® Dokumentation deinstallieren?")
  375.     (set #prompt_install_htmldocs    "Für welche Sprachen wollen Sie die HTML Dokumentation installieren?")
  376.     (set #prompt_uninstall_htmldocs  "Für welche Sprachen wollen Sie die HTML Dokumentation deinstallieren?")
  377.    )
  378.    ( ; english
  379.     (if (= @installer-version 0)
  380.       (
  381.        (set #help_askoptions "With an Installer prior to version 42.6 it can happen that you see checkbox-buttons without labels. Selecting these buttons will be ignored.\n\n")
  382.        (set #help_askchoice  "With an Installer prior to version 42.6 it can happen that you see radio-buttons without labels. Selecting these buttons will result in the next lower available selection.\n\n")
  383.       )
  384.     )
  385.     (set #unknown          "unknown")
  386.     (set #choice_english      "English")
  387.     (set #choice_german       "German")
  388.     (set #choice_french       "French")
  389.     (set #choice_spanish      "Spanish")
  390.     (set #choice_portuguese   "Portuguese")
  391.     (set #choice_danish       "Danish")
  392.     (set #choice_italian      "Italian")
  393.     (set #choice_dutch          "Dutch")
  394.     (set #choice_norwegian    "Norwegian")
  395.     (set #choice_swedish      "Swedish")
  396.     (set #choice_polish       "Polish")
  397.     (set #choice_finnish      "Finnish")
  398.     (set #choice_hungarian    "Hungarian")
  399.     (set #choice_turkish      "Turkish")
  400.     (set #choice_greek          "Greek")
  401.     (set #choice_latin          "Latin")
  402.     (set #choice_esperanto    "Esperanto")
  403.     (set #choice_russian      "Russian")
  404.     (set #choice_czech          "Czech")
  405.     (set #choice_catalonian   "Catalonian")
  406.     (set #choice_croatian     "Croatian")
  407.     (set #choice_serbian      "Serbian")
  408.     (set #choice_slovak       "Slovak")
  409.     (set #choice_slovenian    "Slovenian")
  410.     (set #choice_portuguesebr "Portuguese (Br)") ; LANGUAGE
  411.  
  412.     (set #choice_catalogs   "Catalogs")
  413.     (set #choice_docs        "Documentation")
  414.     (set #choice_developer  "Developer material")
  415.     (set #choice_source     "Source code")
  416.     (set #choice_images     "Images")
  417.     (set #choice_install    "Install")
  418.     (set #choice_update     "Update")
  419.     (set #choice_uninstall  "Uninstall")
  420.     (set #prompt_askcpufpu       (cat "Please select the CPU/FPU configuration for which you want to install " @app-name ".library"))
  421.     (set #prompt_info           (cat "\nWelcome to the " @app-name ".library\n" #copyright "\n\n"))
  422.     (set #prompt_install_uninstall (cat #prompt_info "Do you want to install or uninstall the library?"))
  423.     (set #abort_nocpu ( cat "Sorry, the script is unable to install the " @app-name ".library, because your CPU configuration is not supported.\n"))
  424.     (set #prompt_uninstall_parts "Which parts do you want to uninstall?\n")
  425.     (set #prompt_uninstall_all (cat "Do you want to uninstall all things related with the " @app-name ".library?"))
  426.     (set #help_uninstall_all "If you do not want to uninstall all, you will be asked which parts you want to uninstall.")
  427.     (set #abort_oldversion (cat "The Installer found that version %ld.%ld of the " @app-name ".library is already installed.\n\n"
  428.                 "If you want to reinstall the older version %ld.%ld then please uninstall the newer version first."
  429.                )
  430.     )
  431.     (set #prompt_update (cat "Which parts of the " @app-name ".library do you want to add to the installation?"))
  432.     (set #help_install_demo (cat "The demo is a small program that demonstrates the usage of the " @app-name ".library."))
  433.     (set #help_install_source (cat "The source code of the " @app-name ".library can be used as an example or you can create your own (bug fixed) binaries.\nBe careful - the source code can be in any language!"))
  434.     (set #prompt_copy "Do you want to copy the following file(s)?")
  435.     (set #prompt_makedir "The following directory was not found, so it must be created:")
  436.     (set #exit_uninstall_finished (cat "Uninstallation complete!\n"
  437.                        '"'
  438.                        @app-name
  439.                        '"'
  440.                        " is removed from your "
  441.                        '"'
  442.                        @default-dest
  443.                        '"'
  444.                        " drawer (or partition)."
  445.                   )
  446.     )
  447.     (set #button_abort "Abort Uninstall")
  448. ; ---
  449.     (set #abort_oldos  (cat "To install the " @app-name ".library you need OS %s as a minimum.\n\n"
  450.                 "The installer has found that only OS %s is installed.\n"
  451.                )
  452.     )
  453.     (set #prompt_install_demo    "Do you want to install the supplied demo?")
  454.     (set #prompt_install_source "Do you want to install the source code?")
  455.  
  456.     (set #welcome_install   (cat "Welcome to the library installation utility.\n"
  457.                  "Please indicate how the installation should proceed (based upon your knowledge of the Amiga computer)."
  458.                 )
  459.     )
  460.     (set #welcome_uninstall (cat "Welcome to the library uninstallation utility.\n"
  461.                  "Please indicate how the uninstallation should proceed (based upon your knowledge of the Amiga computer)."
  462.                 )
  463.     )
  464.  
  465.     (set #prompt_install_plangs   "Support for which programming languages do you want to install?")
  466.     (set #prompt_uninstall_plangs "Support for which programming languages do you want to uninstall?")
  467.  
  468.     (set #prompt_install_catalogs    (cat "Which catalogs for the " @app-name ".library do you want to install?"))
  469.     (set #prompt_uninstall_catalogs (cat "Which catalogs for the " @app-name ".library do you want to uninstall?"))
  470.  
  471.     (set #prompt_install_docs    "Which type of documents do you want to install?")
  472.     (set #prompt_uninstall_docs "Which type of documents do you want to uninstall?")
  473.  
  474.     (set #prompt_install_asciidocs   "For which languages do you want to install the ASCII documentation?")
  475.     (set #prompt_uninstall_asciidocs "For which languages do you want to uninstall the ASCII documentation?")
  476.     (set #prompt_install_agdocs      "For which languages do you want to install the AmigaGuide® documentation?")
  477.     (set #prompt_uninstall_agdocs    "For which languages do you want to uninstall the AmigaGuide® documentation?")
  478.     (set #prompt_install_htmldocs    "For which languages do you want to install the HTML documentation?")
  479.     (set #prompt_uninstall_htmldocs  "For which languages do you want to uninstall the HTML documentation?")
  480.    )
  481.  )
  482.  (if (> @installer-version 0)
  483.    (
  484.     (set #help_askoptions "")
  485.     (set #help_askchoice "")
  486.    )
  487.  )
  488.  
  489. ; --- BitToLanguage -----------------------------------------------------------
  490.  
  491.  (procedure P_BitToLanguage
  492.   ; Params:
  493.   ; #langmask
  494.   ;
  495.   ; Results:
  496.   ; #langmask #lang
  497.   ;
  498.   ; Used Vars:
  499.   ; #i #bitmask
  500.  
  501.   (set #i 0)
  502.   (set #bitmask %11111111111111111111111110) ; LANGUAGE
  503.   (while (AND (< #i 25) (NOT (IN #langmask #i))) ; LANGUAGE
  504.     (
  505.      (set #bitmask (BITOR (shiftleft #bitmask 1) %00000000000000000000000001)) ; LANGUAGE
  506.      (set #i (+ #i 1))
  507.     )
  508.   )
  509.   (set #langmask (BITAND #langmask #bitmask))
  510.   (set #lang (select #i "english" "deutsch" "français" "español" "português" "dansk" "italiano" "nederlands" "norsk" "svenska" "polski" "suomi" "magyar" "greek" "esperanto" "türkçe" "latina" "russian" "ÃeÓtina" "catalonian" "Croatian" "srpski" "Slovak" "slovensko" "português-brasil" "")) ; LANGUAGE
  511.  )
  512.  
  513. ; --- GetVersion --------------------------------------------------------------
  514.  
  515.  (procedure P_GetVersion
  516.   ; Param:
  517.   ; #file
  518.   ;
  519.   ; Results:
  520.   ; #ver #rev
  521.   ;
  522.   ; Vars used:
  523.   ; #vernum
  524.  
  525.   (set #vernum (getversion (cat #file)))
  526.   (set #ver (/ #vernum 65536))
  527.   (set #rev (- #vernum (* #ver 65536)))
  528.  )
  529.  
  530. ; --- CompareVersions ---------------------------------------------------------
  531.  
  532.  (procedure P_CompareVersions
  533.   ; Param:
  534.   ; #ver #rev #ver2 #rev2
  535.   ;
  536.   ; Results:
  537.   ; #result
  538.   ; -1 : #ver.#rev < #ver2.#rev2
  539.   ;  0 : #ver.#rev = #ver2.#rev2
  540.   ;  1 : #ver.#rev > #ver2.#rev2
  541.   ;
  542.   ; Used Vars:
  543.  
  544.   (if (< #ver #ver2)
  545.     (set #result -1)
  546.     (if (> #ver #ver2)
  547.       (set #result 1)
  548.       (if (< #rev #rev2)
  549.     (set #result -1)
  550.     (if (> #rev #rev2)
  551.       (set #result 1)
  552.       (set #result 0)
  553.     )
  554.       )
  555.     )
  556.   )
  557.  )
  558.  
  559. ; --- GetOSVersionStr ---------------------------------------------------------
  560.  
  561.  (procedure P_GetOSVersionStr
  562.   ; Param:
  563.   ; #ver #rev
  564.   ;
  565.   ; Results:
  566.   ; #str
  567.   ;
  568.   ; Used Vars:
  569.   ; #i
  570.  
  571.   (set #i 0)
  572.   (while (<> #ver (select #i 30 31 32 33 34 36 37 38 39 40 #ver)) ; OS
  573.     (set #i (+ #i 1))
  574.   )
  575.   (set #str (select #i "1.0" "1.1 NTSC" "1.1 PAL" "1.2" "1.3" "2.0pre" "2.0" "2.1" "3.0" "3.1" #unknown)) ; OS
  576.  )
  577.  
  578. ; --- GetOSVersion ------------------------------------------------------------
  579.  
  580.  (procedure P_GetOSVersion
  581.   ; Param:
  582.   ;
  583.   ; Results:
  584.   ; #os_ver #os_rev #os_str
  585.   ;
  586.   ; Used Vars:
  587.   ; #file #ver #rev #vernum #i #str
  588.  
  589.   (set #file "libs:version.library")
  590.   (P_GetVersion)
  591.   (set #os_ver #ver)
  592.   (set #os_rev #rev)
  593.  
  594.   (P_GetOSVersionStr)
  595.   (set #os_str #str)
  596.  )
  597.  
  598. ; --- GetCPU ------------------------------------------------------------------
  599.  
  600.  (procedure P_GetCPUFPU
  601.   ; Param:
  602.   ;
  603.   ; Results:
  604.   ; #cpu #cpu_str
  605.   ; -1 = unknown; 0 = 68000; 1 = 68010; 2 = 68020; 3 = 68030; 4 = 68040;
  606.   ;          5 = 68060
  607.   ; #fpu #fpu_str
  608.   ; -1 = unknown; 0 = NOFPU; 1 = 68881; 2 = 68882; 3 = FPU40
  609.   ;
  610.   ; Used Vars:
  611.  
  612.   (set #cpu_str (database "cpu"))
  613.   (set #cpu 0)
  614.   (while (<> #cpu_str (select #cpu "68000" "68010" "68020" "68030" "68040""68060" #cpu))
  615.     (set #cpu (+ #cpu 1))
  616.   )
  617.   (if (= #cpu 6)
  618.     (
  619.      (set #cpu -1)
  620.      (set #cpu_str #unknown)
  621.     )
  622.   )
  623.  
  624.   (if @installer-version
  625.     (
  626.      (set #fpu_str (database "fpu"))
  627.      (set #fpu 0)
  628.      (while (<> #fpu_str (select #fpu "NOFPU" "68881" "68882" "FPU40" #fpu_str))
  629.        (set #fpu (+ #fpu 1))
  630.      )
  631.      (if (= #fpu 4)
  632.        (
  633.     (set #fpu -1)
  634.     (set #fpu_str #unknown)
  635.        )
  636.      )
  637.     )
  638.     (
  639.      (set #fpu -1)
  640.      (set #fpu_str #unknown)
  641.     )
  642.   )
  643.  )
  644.  
  645. ; --- AskLanguages ------------------------------------------------------------
  646.  
  647.  (procedure P_AskLanguages
  648.   ; Params:
  649.   ; #prompt #langmask #defaultmask
  650.   ;
  651.   ; Results:
  652.   ; #langmask
  653.   ;
  654.   ; Used Vars:
  655.   ; #bitmask
  656.  
  657.   (set #langmask (BITAND #langmask %1111111111111111111111111)) ; LANGUAGE
  658.   (if #langmask
  659.     (
  660.      (set #bitmask (askoptions (prompt #prompt)
  661.                    (help #help_askoptions @askoptions-help)
  662.                    (default (BITAND #defaultmask #langmask))
  663.                    (choices
  664.                  (if (IN #langmask 0)
  665.                    (cat #prop #choice_english)
  666.                    ("")
  667.                  )
  668.                  (if (IN #langmask 1)
  669.                    (cat #prop #choice_german)
  670.                    ("")
  671.                  )
  672.                  (if (IN #langmask 2)
  673.                    (cat #prop #choice_french)
  674.                    ("")
  675.                  )
  676.                  (if (IN #langmask 3)
  677.                    (cat #prop #choice_spanish)
  678.                    ("")
  679.                  )
  680.                  (if (IN #langmask 4)
  681.                    (cat #prop #choice_portuguese)
  682.                    ("")
  683.                  )
  684.                  (if (IN #langmask 5)
  685.                    (cat #prop #choice_danish)
  686.                    ("")
  687.                  )
  688.                  (if (IN #langmask 6)
  689.                    (cat #prop #choice_italian)
  690.                    ("")
  691.                  )
  692.                  (if (IN #langmask 7)
  693.                    (cat #prop #choice_dutch)
  694.                    ("")
  695.                  )
  696.                  (if (IN #langmask 8)
  697.                    (cat #prop #choice_norwegian)
  698.                    ("")
  699.                  )
  700.                  (if (IN #langmask 9)
  701.                    (cat #prop #choice_swedish)
  702.                    ("")
  703.                  )
  704.                  (if (IN #langmask 10)
  705.                    (cat #prop #choice_polish)
  706.                    ("")
  707.                  )
  708.                  (if (IN #langmask 11)
  709.                    (cat #prop #choice_finnish)
  710.                    ("")
  711.                  )
  712.                  (if (IN #langmask 12)
  713.                    (cat #prop #choice_hungarian)
  714.                    ("")
  715.                  )
  716.                  (if (IN #langmask 13)
  717.                    (cat #prop #choice_greek)
  718.                    ("")
  719.                  )
  720.                  (if (IN #langmask 14)
  721.                    (cat #prop #choice_esperanto)
  722.                    ("")
  723.                  )
  724.                  (if (IN #langmask 15)
  725.                    (cat #prop #choice_turkish)
  726.                    ("")
  727.                  )
  728.                  (if (IN #langmask 16)
  729.                    (cat #prop #choice_latin)
  730.                    ("")
  731.                  )
  732.                  (if (IN #langmask 17)
  733.                    (cat #prop #choice_russian)
  734.                    ("")
  735.                  )
  736.                  (if (IN #langmask 18)
  737.                    (cat #prop #choice_czech)
  738.                    ("")
  739.                  )
  740.                  (if (IN #langmask 19)
  741.                    (cat #prop #choice_catalonian)
  742.                    ("")
  743.                  )
  744.                  (if (IN #langmask 20)
  745.                    (cat #prop #choice_croatian)
  746.                    ("")
  747.                  )
  748.                  (if (IN #langmask 21)
  749.                    (cat #prop #choice_serbian)
  750.                    ("")
  751.                  )
  752.                  (if (IN #langmask 22)
  753.                    (cat #prop #choice_slovak)
  754.                    ("")
  755.                  )
  756.                  (if (IN #langmask 23)
  757.                    (cat #prop #choice_slovenian)
  758.                    ("")
  759.                  )
  760.                  (if (IN #langmask 24)
  761.                    (cat #prop #choice_portuguesebr)
  762.                    ("")
  763.                  )
  764.                  ; LANGUAGE
  765.                    )
  766.            )
  767.      )
  768.      (set #langmask (BITAND #langmask #bitmask))
  769.     )
  770.   )
  771.  )
  772.  
  773. ; --- AskDocFormat ------------------------------------------------------------
  774.  
  775.  (procedure P_AskDocFormats
  776.   ; Params:
  777.   ; #prompt #docmask #defaultmask
  778.   ;
  779.   ; Results:
  780.   ; #docmask
  781.   ;
  782.   ; Used Vars:
  783.   ; #bitmask
  784.  
  785.   (set #docmask (BITAND #docmask %111))
  786.   (if #docmask
  787.     (
  788.      (set #bitmask (askoptions (prompt #prompt)
  789.                    (help #help_askoptions @askoptions-help)
  790.                    (default (BITAND #defaultmask #docmask))
  791.                    (choices
  792.                  (if (IN #docmask 0)
  793.                    (cat #prop "ASCII")
  794.                    ("")
  795.                  )
  796.                  (if (IN #docmask 1)
  797.                    (cat #prop "AmigaGuide®")
  798.                    ("")
  799.                  )
  800.                  (if (IN #docmask 2)
  801.                    (cat #prop "HTML")
  802.                    ("")
  803.                  )
  804.                    )
  805.            )
  806.      )
  807.      (set #docmask (BITAND #docmask #bitmask))
  808.     )
  809.   )
  810.  )
  811.  
  812. ; --- AskProgLang -------------------------------------------------------------
  813.  
  814.  (procedure P_AskProgLangs
  815.   ; Params:
  816.   ; #prompt #plangmask #defaultmask
  817.   ;
  818.   ; Results:
  819.   ; #plangmask
  820.   ;
  821.   ; Used Vars:
  822.   ; #bitmask
  823.  
  824.   (set #plangmask (BITAND #plangmask %001111101))
  825.   (if #plangmask
  826.     (
  827.      (set #bitmask (askoptions (prompt #prompt)
  828.                    (help #help_askoptions @askoptions-help)
  829.                    (default (BITAND #defaultmask #plangmask))
  830.                    (choices
  831.                  (if (IN #plangmask 0)
  832.                    (cat #prop "C")
  833.                    ("")
  834.                  )
  835.                  (if (IN #plangmask 1)
  836.                    (cat #prop "C++")
  837.                    ("")
  838.                  )
  839.                  (if (IN #plangmask 2)
  840.                    (cat #prop "Assembler")
  841.                    ("")
  842.                  )
  843.                  (if (IN #plangmask 3)
  844.                    (cat #prop "Amiga-E")
  845.                    ("")
  846.                  )
  847.                  (if (IN #plangmask 4)
  848.                    (cat #prop "Modula-II")
  849.                    ("")
  850.                  )
  851.                  (if (IN #plangmask 5)
  852.                    (cat #prop "Oberon")
  853.                    ("")
  854.                  )
  855.                  (if (IN #plangmask 6)
  856.                    (cat #prop "ARexx")
  857.                    ("")
  858.                  )
  859.                  (if (IN #plangmask 7)
  860.                    (cat #prop "Cluster")
  861.                    ("")
  862.                  )
  863.                  (if (IN #plangmask 8)
  864.                    (cat #prop "Blitz Basic 2")
  865.                    ("")
  866.                  )
  867.                    )
  868.            )
  869.      )
  870.      (set #plangmask (BITAND #plangmask #bitmask))
  871.     )
  872.   )
  873.  )
  874.  
  875. ; --- DelEmptyDir -------------------------------------------------------------
  876.  
  877.  (procedure P_DelEmptyDir
  878.   ; Params:
  879.   ; #dir
  880.   ;
  881.   ; Results:
  882.   ;
  883.   ; Used Vars:
  884.   ; #i
  885.  
  886.   (set #i 0)
  887.   (if (exists #dir (noreq))
  888.     (
  889.      (foreach #dir "#?"
  890.        (set #i (+ #i 1))
  891.      )
  892.      (if (NOT #i)
  893.        (
  894.     (delete #dir (optional "force"))
  895.     (delete (cat #dir ".info") (optional "force"))
  896.        )
  897.      )
  898.     )
  899.   )
  900.  )
  901.  
  902. ; --- DelDirRecursiv ----------------------------------------------------------
  903.  
  904.  (procedure P_DelDirRecursive
  905.   ; Params:
  906.   ; #dir
  907.   ;
  908.   ; Results:
  909.   ;
  910.   ; Used Vars:
  911.   ;
  912.  
  913.   (foreach #dir "#?"
  914.     (if (< @each-type 0)
  915.       (delete (tackon #dir @each-name) (optional "force"))
  916.       (
  917.        (set #dir (tackon #dir @each-name))
  918.        (P_DelDirRecursive)
  919.        (set #dir (pathonly #dir))
  920.       )
  921.     )
  922.   )
  923.   (delete #dir (optional "force"))
  924.   (delete (cat #dir ".info") (optional "force"))
  925.  )
  926.  
  927. ; --- DeleteLanguages ---------------------------------------------------------
  928.  
  929.  (procedure P_DeleteLanguages
  930.   ; Params:
  931.   ; #dir #file #langmask
  932.   ;
  933.   ; Results:
  934.   ; #langmask
  935.   ;
  936.   ; Used Vars:
  937.   ; #i #lang
  938.  
  939.   (while (P_BitToLanguage)
  940.     (
  941.      (delete (tackon (tackon #dir #lang) #file) (optional "force"))
  942.      (delete (tackon (tackon #dir #lang) (cat #file ".info")) (optional "force"))
  943.      (set #i 0)
  944.      (foreach (tackon #dir #lang) "#?"
  945.        (set #i (+ #i 1))
  946.      )
  947.      (if (NOT #i)
  948.        (
  949.     (delete (tackon #dir #lang) (optional "force"))
  950.     (delete (tackon #dir (cat #lang ".info")) (optional "force"))
  951.        )
  952.      )
  953.     )
  954.   )
  955.  )
  956.  
  957. ; --- MkDirInfo ---------------------------------------------------------------
  958.  
  959.  (procedure P_MkDirInfo
  960.   ; Params:
  961.   ; #dir #infos #dest-dir
  962.   ;
  963.   ; Results:
  964.   ;
  965.   ; Used Vars:
  966.  
  967.   (if (NOT (exists (tackon #dest-dir #dir) (noreq)))
  968.     (if #infos
  969.       (makedir (tackon #dest-dir #dir) (prompt #prompt_makedir "\n\n" (tackon #dest-dir #dir)) (help @makedir-help) (infos) (confirm "expert"))
  970.       (makedir (tackon #dest-dir #dir) (prompt #prompt_makedir "\n\n" (tackon #dest-dir #dir)) (help @makedir-help) (confirm "expert"))
  971.     )
  972.   )
  973.  )
  974.  
  975. ; --- CpFile ------------------------------------------------------------------
  976.  
  977.  (procedure P_CpFile
  978.   ; Params:
  979.   ; #dir #file #infos #dest-dir #src-dir #pattern
  980.   ;
  981.   ; Results:
  982.   ;
  983.   ; Used Vars:
  984.  
  985.   (if #pattern
  986.     (if #infos
  987.       (copyfiles (prompt #prompt_copy)
  988.          (help @copyfiles-help)
  989.          (source (tackon #src-dir #dir))
  990.          (dest (tackon #dest-dir #dir))
  991.          (pattern #file)
  992.          (files)
  993.          (infos)
  994.          (optional "nofail" "force")
  995.          (confirm "expert")
  996.       )
  997.       (copyfiles (prompt #prompt_copy)
  998.          (help @copyfiles-help)
  999.          (source (tackon #src-dir #dir))
  1000.          (dest (tackon #dest-dir #dir))
  1001.          (pattern #file)
  1002.          (files)
  1003.          (optional "nofail" "force")
  1004.          (confirm "expert")
  1005.       )
  1006.     )
  1007.     (if #infos
  1008.       (copyfiles (prompt #prompt_copy)
  1009.          (help @copyfiles-help)
  1010.          (source (tackon (tackon #src-dir #dir) #file))
  1011.          (dest (tackon #dest-dir #dir))
  1012.          (files)
  1013.          (infos)
  1014.          (optional "nofail" "force")
  1015.          (confirm "expert")
  1016.       )
  1017.       (copyfiles (prompt #prompt_copy)
  1018.          (help @copyfiles-help)
  1019.          (source (tackon (tackon #src-dir #dir) #file))
  1020.          (dest (tackon #dest-dir #dir))
  1021.          (files)
  1022.          (optional "nofail" "force")
  1023.          (confirm "expert")
  1024.       )
  1025.     )
  1026.   )
  1027.  )
  1028.  
  1029. ; --- AskCPUFPU ---------------------------------------------------------------
  1030.  
  1031.  (procedure P_AskCPUFPU
  1032.   ; Params:
  1033.   ; #src-dir
  1034.   ;
  1035.   ; Results:
  1036.   ; #cpu #cpu_str #lib_cpu_file_extension #src-dir
  1037.   ;
  1038.   ; Used Vars:
  1039.   ; #i #file #bitmask #filetype #f #lib_cpus #lib_fpus #dir
  1040.   ; #defaultcpu #lib_cpu_counter #fpu #fpu_str #cpu2
  1041.  
  1042.   (set #dir (tackon #src-dir "libs"))
  1043.   (P_CheckAvailableCPUs)
  1044.   (P_GetCPUFPU)
  1045.   (set #defaultcpu -1)
  1046.   (while (AND (>= #cpu 0) (= #defaultcpu -1))
  1047.     (
  1048.      (if (AND #fpu (IN #lib_fpus #cpu))
  1049.        (set #defaultcpu (select #cpu -1 -1 3 5 7 -1))
  1050.        (if (IN #lib_cpus #cpu)
  1051.      (set #defaultcpu (select #cpu 0 1 2 4 6 8))
  1052.        )
  1053.      )
  1054.      (set #cpu (- #cpu 1))
  1055.     )
  1056.   )
  1057.  
  1058.   (if (AND (> #lib_cpu_counter 1) (= @user-level 2))
  1059.     (
  1060.      (set #cpu (askchoice (prompt #prompt_askcpufpu)
  1061.               (help #help_askchoice @askchoice-help)
  1062.               (default #defaultcpu)
  1063.               (choices
  1064.                 (if (IN #lib_cpus 0)
  1065.                   (cat #prop "68000")
  1066.                   ("")
  1067.                 )
  1068.                 (if (IN #lib_cpus 1)
  1069.                   (cat #prop "68010")
  1070.                   ("")
  1071.                 )
  1072.                 (if (IN #lib_cpus 2)
  1073.                   (cat #prop "68020")
  1074.                   ("")
  1075.                 )
  1076.                 (if (IN #lib_fpus 2)
  1077.                   (cat #prop "68020+fpu")
  1078.                   ("")
  1079.                 )
  1080.                 (if (IN #lib_cpus 3)
  1081.                   (cat #prop "68030")
  1082.                   ("")
  1083.                 )
  1084.                 (if (IN #lib_fpus 3)
  1085.                   (cat #prop "68030+fpu")
  1086.                   ("")
  1087.                 )
  1088.                 (if (IN #lib_cpus 4)
  1089.                   (cat #prop "68040")
  1090.                   ("")
  1091.                 )
  1092.                 (if (IN #lib_fpus 4)
  1093.                   (cat #prop "68040+fpu")
  1094.                   ("")
  1095.                 )
  1096.                 (if (IN #lib_cpus 5)
  1097.                   (cat #prop "68060")
  1098.                   ("")
  1099.                 )
  1100.               )
  1101.            )
  1102.      )
  1103.     )
  1104.     (set #cpu #defaultcpu)
  1105.   )
  1106.   (if (<> #cpu -1)
  1107.     (
  1108.      ; select lower cpu if not available
  1109.      (set #cpu2 (select #cpu 0 1 2 2 3 3 4 4 5))
  1110.      (set #fpu2 (select #cpu 0 0 0 1 0 1 0 1 0))
  1111.      (while (NOT (OR (AND #fpu2 (AND #fpu (IN #lib_fpus #cpu2))) (AND (NOT #fpu2) (IN #lib_cpus #cpu2))))
  1112.        (
  1113.     (set #cpu (- #cpu 1))
  1114.     (set #cpu2 (select #cpu 0 1 2 2 3 3 4 4 5))
  1115.     (set #fpu2 (select #cpu 0 0 0 1 0 1 0 1 0))
  1116.        )
  1117.      )
  1118.  
  1119.      (set #cpu_str (select #cpu "68000" "68010" "68020" "68020+fpu" "68030" "68030+fpu" "68040" "68040+fpu" "68060"))
  1120.      (set #lib_cpu_file_extension (select #cpu (if (exists (tackon #dir (cat @app-name "000.lib")) (noreq)) ("000") ("")) "010" "020" "020f" "030" "030f" "040" "040f" "060"))
  1121.      (set #cpu #cpu2)
  1122.     )
  1123.     (
  1124.      (set #cpu2 -1)
  1125.      (set #fpu2 0)
  1126.      (set #cpu_str "")
  1127.      (set #lib_cpu_file_extension "")
  1128.     )
  1129.   )
  1130.   (if (= #cpu -1)
  1131.     (abort #abort_nocpu)
  1132.   )
  1133.  )
  1134.  
  1135. ; --- AskParts ----------------------------------------------------------------
  1136.  
  1137.  (procedure P_AskParts
  1138.   ; Params:
  1139.   ; #prompt #defaultmask #existsmask
  1140.   ;
  1141.   ; Results:
  1142.   ; #parts
  1143.   ;
  1144.   ; Used Vars:
  1145.  
  1146.   (set #existsmask (if (= @user-level 2)
  1147.              #existsmask
  1148.              (BITAND #existsmask %00111)
  1149.            )
  1150.   )
  1151.   (if #existsmask
  1152.     (
  1153.      (set #parts (askoptions (prompt #prompt)
  1154.                  (help #help_askoptions @askoptions-help)
  1155.                  (default (BITAND #defaultmask #existsmask))
  1156.                  (choices
  1157.                 (if (IN #existsmask 0)
  1158.                   (cat #prop #choice_catalogs)
  1159.                   ("")
  1160.                 )
  1161.                 (if (IN #existsmask 1)
  1162.                   (cat #prop #choice_docs)
  1163.                   ("")
  1164.                 )
  1165.                 (if (IN #existsmask 2)
  1166.                   (cat #prop @app-name "-Demo")
  1167.                   ("")
  1168.                 )
  1169.                 (if (IN #existsmask 3)
  1170.                   (cat #prop #choice_developer)
  1171.                   ("")
  1172.                 )
  1173.                 (if (IN #existsmask 4)
  1174.                   (cat #prop #choice_source)
  1175.                   ("")
  1176.                 )
  1177.                  )
  1178.          )
  1179.      )
  1180.      (set #parts (BITAND #parts #existsmask))
  1181.     )
  1182.     (set #parts 0)
  1183.   )
  1184.  )
  1185.  
  1186. ; --- CheckAvailableCPUs ------------------------------------------------------
  1187.  
  1188.  (procedure P_CheckAvailableCPUs
  1189.   ; Params:
  1190.   ; #dir @app-name
  1191.   ;
  1192.   ; Results:
  1193.   ; #lib_cpus #lib_fpus #lib_cpu_counter
  1194.   ;
  1195.   ; Used Vars:
  1196.   ; #i #file #bitmask #filetype #f
  1197.  
  1198.   (set #lib_cpus %000000)
  1199.   (set #lib_fpus %000000)
  1200.   (set #lib_cpu_counter 0)
  1201.   (if (OR
  1202.     (OR
  1203.       (OR
  1204.         (OR
  1205.           (exists (tackon #dir (cat @app-name ".library")) (noreq))
  1206.           (exists (tackon #dir (cat @app-name "000.library")) (noreq))
  1207.         )
  1208.         (OR
  1209.           (exists (tackon #dir (cat @app-name "010.library")) (noreq))
  1210.           (exists (tackon #dir (cat @app-name "020.library")) (noreq))
  1211.         )
  1212.       )
  1213.       (OR
  1214.         (OR
  1215.           (exists (tackon #dir (cat @app-name "030.library")) (noreq))
  1216.           (exists (tackon #dir (cat @app-name "040.library")) (noreq))
  1217.         )
  1218.         (exists (tackon #dir (cat @app-name "060.library")) (noreq))
  1219.       )
  1220.     )
  1221.     (OR
  1222.       (OR
  1223.         (exists (tackon #dir (cat @app-name "020f.library")) (noreq))
  1224.         (exists (tackon #dir (cat @app-name "030f.library")) (noreq))
  1225.       )
  1226.       (exists (tackon #dir (cat @app-name "040f.library")) (noreq))
  1227.     )
  1228.       )
  1229.     (foreach #dir (cat @app-name "(%|0(0|1|2|3|4|6)0)(%|f).library")
  1230.       (
  1231.        (set #i 0)
  1232.        (set #file (substr @each-name (strlen @app-name)))
  1233.        (set #f (patmatch "#?f.library" #file))
  1234.        (if #f
  1235.      (set #file (cat (substr #file 0 (- (strlen #file) 9)) ".library"))
  1236.        )
  1237.        (set #bitmask %000001)
  1238.        (while (NOT (patmatch (select #i "(%|000).library" "010.library" "020.library" "030.library" "040.library" "060.library") #file))
  1239.      (
  1240.       (set #bitmask (shiftleft #bitmask 1))
  1241.       (set #i (+ #i 1))
  1242.      )
  1243.        )
  1244.        (if #f
  1245.      (set #lib_fpus (BITOR #lib_fpus #bitmask))
  1246.      (set #lib_cpus (BITOR #lib_cpus #bitmask))
  1247.        )
  1248.        (set #lib_cpu_counter (+ #lib_cpu_counter 1))
  1249.       )
  1250.     )
  1251.   )
  1252.  )
  1253.  
  1254. ; --- CheckExists -------------------------------------------------------------
  1255.  
  1256.  (procedure P_CheckExists
  1257.    ; Param:
  1258.    ; #dir
  1259.    ;
  1260.    ; Results:
  1261.    ; #chk_lib #chk_demo #chk_catalogs #chk_agdocs #chk_proglang
  1262.    ; #chk_autodoc #chk_c_h #chk_c_example #chk_asm_i #chk_asm_example #chk_e_e
  1263.    ; #chk_e_example #chk_modula_def #chk_modula_mod #chk_modula_demo
  1264.    ; #chk_oberon_mod #chk_oberon_example #chk_existsmask
  1265.    ; #chk_docs #chk_progdirs #chk_asciidocs #chk_source
  1266.    ; #chk_htmldocs #chk_rexx #chk_rexx_example #chk_cluster_def
  1267.    ; #chk_cluster_mod #chk_cluster_demo #chk_bb2 #chk_bb2_example
  1268.    ;
  1269.    ; Vars used:
  1270.    ; #i #lang
  1271.  
  1272.    ; Custom Class
  1273.    (set #chk_lib (exists (tackon (tackon #dir "Libs") (cat @app-name ".library")) (noreq)))
  1274.  
  1275.    ; Demo
  1276.    (set #chk_demo (exists (tackon (tackon #dir "Demos") (cat @app-name "-Demo")) (noreq)))
  1277.  
  1278.    ; Catalogs + Documentation
  1279.    (set #chk_catalogs  %0000000000000000000000000) ; LANGUAGE
  1280.    (set #chk_asciidocs %0000000000000000000000000) ; LANGUAGE
  1281.    (set #chk_agdocs    %0000000000000000000000000) ; LANGUAGE
  1282.    (set #chk_htmldocs  %0000000000000000000000000) ; LANGUAGE
  1283.    (set #langmask      %1111111111111111111111111) ; LANGUAGE
  1284.    (while (P_BitToLanguage)
  1285.      (
  1286.       ; Catalogs
  1287.       (if (exists (tackon (tackon (tackon #dir "locale/catalogs") #lang) (cat @app-name "_lib.catalog")) (noreq))
  1288.     (
  1289.      (set #chk_catalogs (BITOR #chk_catalogs %10000000000000000000000000)) ; LANGUAGE
  1290.      (set #chk_catalogs (shiftright #chk_catalogs 1))
  1291.     )
  1292.     (set #chk_catalogs (shiftright #chk_catalogs 1))
  1293.       )
  1294.  
  1295.       ; Docs/ASCII
  1296.       (if (exists (tackon (tackon (tackon #dir "Docs") #lang) (cat @app-name "Lib.doc")) (noreq))
  1297.     (
  1298.      (set #chk_asciidocs (BITOR #chk_asciidocs %10000000000000000000000000)) ; LANGUAGE
  1299.      (set #chk_asciidocs (shiftright #chk_asciidocs 1))
  1300.     )
  1301.     (set #chk_asciidocs (shiftright #chk_asciidocs 1))
  1302.       )
  1303.  
  1304.       ; Docs/AmigaGuide
  1305.       (if (exists (tackon (tackon (tackon #dir "Docs") #lang) (cat @app-name "Lib.guide")) (noreq))
  1306.     (
  1307.      (set #chk_agdocs (BITOR #chk_agdocs %10000000000000000000000000)) ; LANGUAGE
  1308.      (set #chk_agdocs (shiftright #chk_agdocs 1))
  1309.     )
  1310.     (set #chk_agdocs (shiftright #chk_agdocs 1))
  1311.       )
  1312.  
  1313.       ; Docs/HTML
  1314.       (if (exists (tackon (tackon (tackon #dir "Docs") #lang) (cat @app-name "_home.html")) (noreq))
  1315.     (
  1316.      (set #chk_htmldocs (BITOR #chk_htmldocs %10000000000000000000000000)) ; LANGUAGE
  1317.      (set #chk_htmldocs (shiftright #chk_htmldocs 1))
  1318.     )
  1319.     (set #chk_htmldocs (shiftright #chk_htmldocs 1))
  1320.       )
  1321.  
  1322.      )
  1323.    )
  1324.    (set #chk_docs (BITOR
  1325.             (if #chk_htmldocs  %100 %000)
  1326.             (BITOR
  1327.               (if #chk_agdocs     %010 %000)
  1328.               (if #chk_asciidocs %001 %000)
  1329.             )
  1330.           )
  1331.    )
  1332.  
  1333.    ; Developer
  1334.    (set #chk_proglang %0000000000)
  1335.    (set #chk_progdirs %0000000000)
  1336.    (set #chk_autodoc (exists (tackon (tackon #dir "Developer/Autodocs") (cat @app-name ".doc")) (noreq)))
  1337.    ; C
  1338.    (set #chk_progdirs (BITOR #chk_progdirs (if (exists (tackon #dir "Developer/C") (noreq)) %0000000001 %0000000000)))
  1339.    (set #chk_c_h       (exists (tackon (tackon #dir "Developer/C/Include/Libraries") (cat @app-name ".h")) (noreq)))
  1340.    (set #chk_c_example (exists (tackon (tackon #dir "Developer/C/Examples") (cat @app-name "-Demo.c")) (noreq)))
  1341.    (if #chk_c_h
  1342.      (set #chk_proglang (BITOR #chk_proglang %0000000001))
  1343.    )
  1344.    ; C++
  1345.  
  1346.    ; Assembler
  1347.    (set #chk_progdirs (BITOR #chk_progdirs (if (exists (tackon #dir "Developer/Assembler") (noreq)) %0000000100 %0000000000)))
  1348.    (set #chk_asm_i     (exists (tackon (tackon #dir "Developer/Assembler/Include/Libraries") (cat @app-name ".i")) (noreq)))
  1349.    (set #chk_asm_example (exists (tackon (tackon #dir "Developer/Assembler/Examples") (cat @app-name "-Demo.s")) (noreq)))
  1350.    (if #chk_asm_i
  1351.      (set #chk_proglang (BITOR #chk_proglang %0000000100))
  1352.    )
  1353.    ; Amiga-E
  1354.    (set #chk_progdirs (BITOR #chk_progdirs (if (exists (tackon #dir "Developer/Amiga-E") (noreq)) %0000001000 %0000000000)))
  1355.    (set #chk_e_e       (exists (tackon (tackon #dir "Developer/Amiga-E/Modules/Libraries") (cat @app-name ".e")) (noreq)))
  1356.    (set #chk_e_example (exists (tackon (tackon #dir "Developer/Amiga-E/Examples") (cat @app-name "-Demo.e")) (noreq)))
  1357.    (if #chk_e_e
  1358.      (set #chk_proglang (BITOR #chk_proglang %0000001000))
  1359.    )
  1360.    ; Modula-II
  1361.    (set #chk_progdirs (BITOR #chk_progdirs (if (exists (tackon #dir "Developer/Modula") (noreq)) %0000010000 %0000000000)))
  1362.    (set #chk_modula_def  (exists (tackon (tackon #dir "Developer/Modula/Defs") (cat @app-name "D.def")) (noreq)))
  1363.    (set #chk_modula_mod  (exists (tackon (tackon #dir "Developer/Modula/Defs") (cat @app-name "L.def")) (noreq)))
  1364.    (set #chk_modula_demo (exists (tackon (tackon #dir "Developer/Modula/Demo") (cat @app-name "Demo.mod")) (noreq)))
  1365.    (if (AND #chk_modula_def #chk_modula_mod)
  1366.      (set #chk_proglang (BITOR #chk_proglang %0000010000))
  1367.    )
  1368.    ; Oberon
  1369.    (set #chk_progdirs (BITOR #chk_progdirs (if (exists (tackon #dir "Developer/Oberon") (noreq)) %0000100000 %0000000000)))
  1370.    (set #chk_oberon_mod     (exists (tackon (tackon #dir "Developer/Oberon/Interfaces") (cat @app-name ".mod")) (noreq)))
  1371.    (set #chk_oberon_example (exists (tackon (tackon #dir "Developer/Oberon/Examples") (cat @app-name "Demo.mod")) (noreq)))
  1372.    (if #chk_oberon_mod
  1373.      (set #chk_proglang (BITOR #chk_proglang %0000100000))
  1374.    )
  1375.    ; ARexx
  1376.    (set #chk_progdirs (BITOR #chk_progdirs (if (exists (tackon #dir "Developer/Rexx") (noreq)) %0001000000 %0000000000)))
  1377.    (set #chk_rexx  (exists (tackon (tackon #dir "Developer/Rexx/Include") (cat @app-name ".rexx")) (noreq)))
  1378.    (set #chk_rexx_example (exists (tackon (tackon #dir "Developer/Rexx/Examples") (cat @app-name "-Demo.rexx")) (noreq)))
  1379.    (if #chk_rexx
  1380.      (set #chk_proglang (BITOR #chk_proglang %0001000000))
  1381.    )
  1382.    ; Cluster
  1383.    (set #chk_progdirs (BITOR #chk_progdirs (if (exists (tackon #dir "Developer/Cluster") (noreq)) %0010000000 %0000000000)))
  1384.    (set #chk_cluster_def  (exists (tackon (tackon #dir "Developer/Cluster/txt") (cat @app-name ".def")) (noreq)))
  1385.    (set #chk_cluster_mod  (exists (tackon (tackon #dir "Developer/Cluster/txt") (cat @app-name ".mod")) (noreq)))
  1386.    (set #chk_cluster_demo (exists (tackon (tackon #dir "Developer/Cluster/txt") (cat @app-name "Demo.mod")) (noreq)))
  1387.    (if (AND #chk_cluster_def #chk_cluster_mod)
  1388.      (set #chk_proglang (BITOR #chk_proglang %0010000000))
  1389.    )
  1390.    ; Blitz Basic 2
  1391.    (set #chk_progdirs (BITOR #chk_progdirs (if (exists (tackon #dir "Developer/BB2") (noreq)) %0100000000 %0000000000)))
  1392.    (set #chk_bb2  (exists (tackon (tackon #dir "Developer/BB2/Include/Libraries") (cat @app-name ".asc")) (noreq)))
  1393.    (set #chk_bb2_example (exists (tackon (tackon #dir "Developer/BB2/Examples") (cat @app-name "-Demo.asc")) (noreq)))
  1394.    (if #chk_bb2
  1395.      (set #chk_proglang (BITOR #chk_proglang %0100000000))
  1396.    )
  1397.  
  1398.    ; Source
  1399.    (if (= (exists (tackon (tackon #dir "Developer/Source") (cat @app-name "Lib")) (noreq)) 2)
  1400.      (set #chk_source 1)
  1401.      (set #chk_source 0)
  1402.    )
  1403.  
  1404.    (set #chk_existsmask (BITOR
  1405.               (if #chk_catalogs %00001 %00000)
  1406.               (BITOR
  1407.                 (if #chk_docs %00010 %00000)
  1408.                 (BITOR
  1409.                   (if #chk_demo %00100 %00000)
  1410.                   (BITOR
  1411.                 (if #chk_proglang %01000 %00000)
  1412.                 (if #chk_source %10000 %00000)
  1413.                   )
  1414.                 )
  1415.               )
  1416.             )
  1417.    )
  1418.  )
  1419.  
  1420. ; --- CheckInstalled ----------------------------------------------------------
  1421.  
  1422.  (procedure P_CheckInstalled
  1423.    ; Param:
  1424.    ; #dir
  1425.    ;
  1426.    ; Results:
  1427.    ; #old_lib #old_demo #old_catalogs #old_proglang
  1428.    ; #old_c_h #old_asm_i #old_e_e
  1429.    ; #old_modula_def #old_modula_mod
  1430.    ; #old_oberon_mod #old_existsmask
  1431.    ; #old_progdirs
  1432.    ; #old_rexx #old_cluster_def
  1433.    ; #old_cluster_mod #old_bb2
  1434.    ;
  1435.    ; Vars used:
  1436.    ; #i #lang
  1437.  
  1438.    ; Custom Class
  1439.    (set #old_lib (exists (tackon "Libs:" (cat @app-name ".library")) (noreq)))
  1440.  
  1441.    ; Catalogs + Documentation
  1442.    (set #old_catalogs  %0000000000000000000000000) ; LANGUAGE
  1443.    (set #langmask      %1111111111111111111111111) ; LANGUAGE
  1444.    (while (P_BitToLanguage)
  1445.      (
  1446.       ; Catalogs
  1447.       (if (exists (tackon (tackon "Locale:catalogs" #lang) (cat @app-name "_lib.catalog")) (noreq))
  1448.     (
  1449.      (set #old_catalogs (BITOR #old_catalogs %10000000000000000000000000)) ; LANGUAGE
  1450.      (set #old_catalogs (shiftright #old_catalogs 1))
  1451.     )
  1452.     (set #old_catalogs (shiftright #old_catalogs 1))
  1453.       )
  1454.  
  1455.      )
  1456.    )
  1457.  
  1458.    ; Developer
  1459.    (set #old_proglang %0000000000)
  1460.    (set #old_progdirs %0000000000)
  1461.    ; C
  1462.    (set #old_c_h       (exists (tackon "Include:Libraries" (cat @app-name ".h")) (noreq)))
  1463.    (if #old_c_h
  1464.      (set #old_proglang (BITOR #old_proglang %0000000001))
  1465.      (set #old_progdirs (BITOR #old_progdirs %0000000001))
  1466.    )
  1467.    ; C++
  1468.  
  1469.    ; Assembler
  1470.  
  1471.    (set #old_asm_i     (exists (tackon "AINC:Libraries" (cat @app-name ".i")) (noreq)))
  1472.    (if #old_asm_i
  1473.      (set #old_proglang (BITOR #old_proglang %0000000100))
  1474.      (set #old_progdirs (BITOR #old_progdirs %0000000100))
  1475.    )
  1476.    ; Amiga-E
  1477.    (set #old_e_e       (exists (tackon "EModules:Libraries" (cat @app-name ".e")) (noreq)))
  1478.    (if #old_e_e
  1479.      (set #old_proglang (BITOR #old_proglang %0000001000))
  1480.      (set #old_progdirs (BITOR #old_progdirs %0000001000))
  1481.    )
  1482.    ; Modula-II
  1483.    (set #old_modula_def  (exists (tackon "M2:Defs" (cat @app-name "D.def")) (noreq)))
  1484.    (set #old_modula_mod  (exists (tackon "M2:Defs" (cat @app-name "L.def")) (noreq)))
  1485.    (if (AND #old_modula_def #old_modula_mod)
  1486.      (set #old_proglang (BITOR #old_proglang %0000010000))
  1487.      (set #old_progdirs (BITOR #old_progdirs %0000010000))
  1488.    )
  1489.    ; Oberon
  1490.    (set #old_oberon_mod     (exists (tackon "Oberon:Interfaces" (cat @app-name ".mod")) (noreq)))
  1491.    (if #old_oberon_mod
  1492.      (set #old_proglang (BITOR #old_proglang %0000100000))
  1493.      (set #old_progdirs (BITOR #old_progdirs %0000100000))
  1494.    )
  1495.    ; ARexx
  1496.    (set #old_rexx  (exists (tackon "Rexx:" (cat @app-name ".rexx")) (noreq)))
  1497.    (if #old_rexx
  1498.      (set #old_proglang (BITOR #old_proglang %0001000000))
  1499.      (set #old_progdirs (BITOR #old_progdirs %0001000000))
  1500.    )
  1501.    ; Cluster
  1502.  ;   (set #old_cluster_def  (exists (tackon "Cluster:txt" (cat @app-name ".def")) (noreq)))
  1503.  ;   (set #old_cluster_mod  (exists (tackon "Cluster:txt" (cat @app-name ".mod")) (noreq)))
  1504.  ;   (if (AND #old_cluster_def #old_cluster_mod)
  1505.  ;     (set #old_proglang (BITOR #old_proglang %0010000000))
  1506.  ;     (set #old_progdirs (BITOR #old_progdirs %0010000000))
  1507.  ;   )
  1508.    ; Blitz Basic 2
  1509.  ;   (set #old_bb2  (exists (tackon "BLITZ2:Include/Libraries" (cat @app-name ".asc")) (noreq)))
  1510.  ;   (if #old_bb2
  1511.  ;     (set #old_proglang (BITOR #old_proglang %0100000000))
  1512.  ;     (set #old_progdirs (BITOR #old_progdirs %0100000000))
  1513.  ;   )
  1514.  
  1515.    (set #old_existsmask (BITOR
  1516.               (if #old_catalogs %00001 %00000)
  1517.               (BITOR
  1518.           %00000 ;  (if #old_docs %00010 %00000)
  1519.                 (BITOR
  1520.           %00000 ;    (if #old_demo %00100 %00000)
  1521.                   (if #old_proglang %01000 %00000)
  1522.                 )
  1523.               )
  1524.             )
  1525.    )
  1526.  )
  1527.  
  1528. ; --- Install -----------------------------------------------------------------
  1529.  
  1530.  (procedure P_Install
  1531.   ; Params:
  1532.   ; #chk_lib #chk_demo #chk_catalogs #chk_docs
  1533.   ; #chk_asciidocs #chk_agdocs #chk_proglang #chk_progdirs #chk_autodoc
  1534.   ; #old_lib #old_demo #old_catalogs #old_docs
  1535.   ; #old_asciidocs #old_agdocs #old_proglang #old_progdirs #old_autodoc
  1536.   ; #update #lib_cpu_counter #chk_source #chk_existsmask #src-dir #dest-dir
  1537.   ; #chk_htmldocs
  1538.   ;
  1539.   ; Results:
  1540.   ;
  1541.   ; Used Vars:
  1542.   ; #dir #file #result #update #defaultmask
  1543.   ; #parts #prompt #langmask #install_catalogs
  1544.   ; #docmask #install_docs #install_asciidocs #install_agdocs #install_demo
  1545.   ; #plangmask #install_proglang #infos #existsmask #install_htmldocs
  1546.  
  1547.   ; Update existing version or install newer one
  1548.  
  1549.   (if (= #update 1)
  1550.     (
  1551.      (set #prompt #prompt_update)
  1552.      (set #existsmask (BITAND #chk_existsmask (BITOR
  1553.                        %01001 ; (if (AND (NOT #old_demo) #chk_demo) %01001 %01001)
  1554.                        %01001 ; (if (AND (NOT #old_source) #chk_source) %01001 %01001)
  1555.                           )
  1556.               )
  1557.      )
  1558.      (set #defaultmask %0000000)
  1559.      (P_AskParts)
  1560.     )
  1561.   )
  1562.  
  1563.   ; (P_AskCPUFPU)
  1564.   (if (NOT #update)
  1565.     (P_AskCPUFPU)
  1566.     (set #lib_cpu_counter 0)
  1567.   )
  1568.  
  1569.   ; lib (P_AskLanguages)
  1570.   (if (OR (NOT #update) (AND #update (IN #parts 0)))
  1571.     (
  1572.      (set #prompt #prompt_install_catalogs)
  1573.      (set #langmask (if #update (BITAND #chk_catalogs (BITNOT #old_catalogs)) #chk_catalogs))
  1574.      (set #defaultmask (if #update (BITAND #language_default (BITNOT #old_catalogs)) (BITOR #language_default #old_catalogs)))
  1575.      (P_AskLanguages)
  1576.      (set #install_catalogs #langmask)
  1577.     )
  1578.     (set #install_catalogs 0)
  1579.   )
  1580.  
  1581.   ; (P_AskProgLangs)
  1582.   (if (OR (AND (NOT #update) (= @user-level 2)) (AND #update (IN #parts 3)))
  1583.     (
  1584.      (set #prompt #prompt_install_plangs)
  1585.      (set #plangmask (if #update (BITAND #chk_proglang (BITNOT #old_proglang)) #chk_proglang))
  1586.      (set #defaultmask #old_progdirs)
  1587.      (P_AskProgLangs)
  1588.      (set #install_proglang #plangmask)
  1589.     )
  1590.     (set #install_proglang 0)
  1591.   )
  1592.  
  1593.   (complete 0)
  1594.  
  1595.   ; lib
  1596.   (if (AND (> #lib_cpu_counter 0) (NOT #update))
  1597.     (copyfiles (prompt #prompt_copy "\n\n" @app-name #lib_cpu_file_extension ".library")
  1598.            (help @copylib-help)
  1599.            (confirm "expert")
  1600.            (source (tackon (tackon #src-dir "libs") (cat @app-name #lib_cpu_file_extension ".library")))
  1601.            (dest "Libs:")
  1602.            (newname (cat @app-name ".library"))
  1603.            (optional "oknodelete" "force")
  1604.     )
  1605.   )
  1606.   (complete 11)
  1607.  
  1608.   ; lib catalogs
  1609.   (if #install_catalogs
  1610.     (
  1611.      (set #infos 0)
  1612.      (set #pattern 0)
  1613.      (set #langmask #install_catalogs)
  1614.      (set #src-dir  "Locale")
  1615.      (set #dest-dir "Locale:")
  1616.      (while #langmask
  1617.        (
  1618.     (P_BitToLanguage)
  1619.     (set #dir (tackon "Catalogs" #lang))
  1620.     (P_MkDirInfo)
  1621.     (set #file (cat @app-name "_lib.catalog"))
  1622.     (P_CpFile)
  1623.        )
  1624.      )
  1625.     )
  1626.   )
  1627.   (complete 33)
  1628.  
  1629.   (if #install_proglang
  1630.     (
  1631.      ; C
  1632.      (if (IN #install_proglang 0)
  1633.        (
  1634.     (set #src-dir  "Developer/C/Include")
  1635.     (set #dest-dir "Include:")
  1636.     (set #infos 0)
  1637.     (set #dir "Libraries")
  1638.     (set #pattern 0)
  1639.     (set #file (cat @app-name ".h"))
  1640.     (P_CpFile)
  1641.     (set #dir "Proto")
  1642.     (set #file (cat @app-name ".h"))
  1643.     (P_CpFile)
  1644.     (set #dir "CLib")
  1645.     (set #file (cat @app-name "_protos.h"))
  1646.     (P_CpFile)
  1647.     (set #dir "Pragmas")
  1648.     (set #file (cat @app-name "_pragmas.h"))
  1649.     (P_CpFile)
  1650.        )
  1651.      )
  1652.  
  1653.      ; C++
  1654.  ;   (if (IN #install_proglang 1)
  1655.  ;   )
  1656.  
  1657.      ; Asm
  1658.      (if (IN #install_proglang 2)
  1659.        (
  1660.     (set #src-dir  "Developer/Assembler/Include")
  1661.     (set #dest-dir "AINC:") ; OMA
  1662.     (set #infos 0)
  1663.     (set #dir "Libraries")
  1664.     (set #file (cat @app-name ".i"))
  1665.     (set #pattern 0)
  1666.     (P_CpFile)
  1667.     (set #dir "lvo")
  1668.     (set #file (cat @app-name ".i"))
  1669.     (P_CpFile)
  1670.        )
  1671.      )
  1672.  
  1673.      ; Amiga-E
  1674.      (if (IN #install_proglang 3)
  1675.        (
  1676.     (set #src-dir  "Developer/Amiga-E/Modules")
  1677.     (set #dest-dir "EMODULES:")
  1678.     (set #infos 0)
  1679.     (set #dir "")
  1680.     (set #file (cat @app-name "_pragmas.m"))
  1681.     (set #pattern 0)
  1682.     (P_CpFile)
  1683.     (set #dir "Libraries")
  1684.     (set #file (cat @app-name ".e"))
  1685.     (P_CpFile)
  1686.        )
  1687.      )
  1688.  
  1689.      ; Modula-II
  1690.      (if (IN #install_proglang 4)
  1691.        (
  1692.     (set #src-dir  "Developer/Modula")
  1693.     (set #dest-dir "M2:")
  1694.     (set #infos 0)
  1695.     (set #dir "Defs")
  1696.     (set #pattern 0)
  1697.     (set #file (cat @app-name "D.def"))
  1698.     (P_CpFile)
  1699.     (set #file (cat @app-name "L.def"))
  1700.     (P_CpFile)
  1701.        )
  1702.      )
  1703.  
  1704.      ; Oberon
  1705.      (if (IN #install_proglang 5)
  1706.        (
  1707.     (set #src-dir  "Developer/Oberon")
  1708.     (set #dest-dir "Oberon:")
  1709.     (set #infos 0)
  1710.     (set #dir "Interfaces")
  1711.     (set #file (cat @app-name ".mod"))
  1712.     (set #pattern 0)
  1713.     (P_CpFile)
  1714.        )
  1715.      )
  1716.  
  1717.      ; ARexx
  1718.      (if (IN #install_proglang 6)
  1719.        (
  1720.     (set #src-dir  "Developer/Rexx/Include")
  1721.     (set #dest-dir "Rexx:")
  1722.     (set #infos 0)
  1723.     (set #dir "")
  1724.     (set #pattern 0)
  1725.     (set #file (cat @app-name ".rexx"))
  1726.     (P_CpFile)
  1727.        )
  1728.      )
  1729.  
  1730.      ; Cluster
  1731.  ;   (if (IN #install_proglang 7)
  1732.  ;     (
  1733.  ;    (set #src-dir  "Developer/Cluster/txt")
  1734.  ;    (set #dest-dir "Cluster:Modules")
  1735.  ;    (set #infos 0)
  1736.  ;    (set #dir "")
  1737.  ;    (set #pattern 0)
  1738.  ;    (set #file (cat @app-name ".def"))
  1739.  ;    (P_CpFile)
  1740.  ;    (set #file (cat @app-name ".mod"))
  1741.  ;    (P_CpFile)
  1742.  ;     )
  1743.  ;   )
  1744.  
  1745.      ; Blitz Basic 2
  1746.  ;   (if (IN #install_proglang 8)
  1747.  ;     (
  1748.  ;    (set #src-dir  "Developer/BB2")
  1749.  ;    (set #dest-dir "BLITZ2:")
  1750.  ;    (set #infos 0)
  1751.  ;    (set #dir "Include/Libraries")
  1752.  ;    (set #pattern 0)
  1753.  ;    (set #file (cat @app-name ".asc"))
  1754.  ;    (P_CpFile)
  1755.  ;    (set #dir "blitzlibs/amigalibs")
  1756.  ;    (set #file (cat @app-name ".library1"))
  1757.  ;    (P_CpFile)
  1758.  ;     )
  1759.  ;   )
  1760.  
  1761.     )
  1762.   )
  1763.  
  1764.   (P_CustomInstall)
  1765.   (complete 100)
  1766.  )
  1767.  
  1768. ; --- Uninstall ---------------------------------------------------------------
  1769.  
  1770.  (procedure P_Uninstall
  1771.   ; Params:
  1772.   ; #old_catalogs #old_docs #old_proglang #old_lib
  1773.   ; #old_asciidocs #old_agdocs #old_demo
  1774.   ; #old_c_h #old_c_example #old_asm_i #old_asm_example #old_e_e #old_e_example
  1775.   ; #old_modula_def #old_modula_mod #old_modula_demo #old_oberon_mod
  1776.   ; #old_oberon_example #old_autodoc #old_source #old_existsmask #dest-dir
  1777.   ; #old_htmldocs #old_rexx #old_rexx_example #old_cluster_def
  1778.   ; #old_cluster_mod #old_cluster_demo #old_bb2 #old_bb2_example
  1779.   ;
  1780.   ; Results:
  1781.   ;
  1782.   ; Used Vars:
  1783.   ; #all #prompt #parts #defaultmask #langmask #uninstall_catalogs
  1784.   ; #docmask #uninstall_asciidocs #uninstall_agdocs
  1785.   ; #plangmask #uninstall_proglang #dir #file #existsmask #oldlangmask
  1786.  
  1787.   (set #existsmask #old_existsmask)
  1788.   (set #all (askbool (prompt #prompt_uninstall_all)
  1789.              (help #help_uninstall_all)
  1790.              (default 1)
  1791.         )
  1792.   )
  1793.   (if (NOT #all)
  1794.     (
  1795.      (set #prompt #prompt_uninstall_parts)
  1796.      (set #defaultmask %0000000)
  1797.      (P_AskParts)
  1798.      (if (IN #parts 0)
  1799.        (
  1800.     (set #prompt #prompt_uninstall_catalogs)
  1801.     (set #langmask #old_catalogs)
  1802.     (set #defaultmask %0000000000000000000000000) ; LANGUAGE
  1803.     (P_AskLanguages)
  1804.     (set #uninstall_catalogs #langmask)
  1805.        )
  1806.      )
  1807.  
  1808.      (if (IN #parts 3)
  1809.        (
  1810.     (set #prompt #prompt_uninstall_plangs)
  1811.     (set #plangmask #old_proglang)
  1812.     (set #defaultmask %0000000000)
  1813.     (P_AskProgLangs)
  1814.     (set #uninstall_proglang #plangmask)
  1815.        )
  1816.      )
  1817.     )
  1818.   )
  1819.   (complete 0)
  1820.  
  1821.   ; lib
  1822.   (if (AND #old_lib #all)
  1823.     (delete (tackon #dest-dir (cat @app-name ".library")) (optional "force"))
  1824.   )
  1825.   (complete 13)
  1826.  
  1827.   ; Catalogs
  1828.   (if (AND #old_catalogs (OR #all (IN #parts 0)))
  1829.     (
  1830.      (if #old_catalogs
  1831.        (
  1832.     (set #dir "Locale:Catalogs")
  1833.     (set #file (cat @app-name "_lib.catalog"))
  1834.     (set #langmask (if #all #old_catalogs #uninstall_catalogs))
  1835.     (P_DeleteLanguages)
  1836.        )
  1837.      )
  1838.     )
  1839.   )
  1840.   (complete 38)
  1841.  
  1842.    ; Developer
  1843.   (if (AND #old_proglang (OR #all (IN #parts 3)))
  1844.     (
  1845.  
  1846.      ; C
  1847.      (if (OR #all (IN #uninstall_proglang 0))
  1848.        (
  1849.     (if #old_c_h
  1850.       (
  1851.        (set #dest-dir "Include:")
  1852.        (set #dir (tackon #dest-dir "Libraries"))
  1853.        (delete (tackon #dir (cat @app-name ".h")) (optional "force"))
  1854.        (set #dir (tackon #dest-dir "Proto"))
  1855.        (delete (tackon #dir (cat @app-name ".h")) (optional "force"))
  1856.        (set #dir (tackon #dest-dir "CLib"))
  1857.        (delete (tackon #dir (cat @app-name "_protos.h")) (optional "force"))
  1858.        (set #dir (tackon #dest-dir "Pragmas"))
  1859.        (delete (tackon #dir (cat @app-name "_pragmas.h")) (optional "force"))
  1860.       )
  1861.     )
  1862.        )
  1863.      )
  1864.  
  1865.      ; C++
  1866. ;    (if (OR #all (IN #uninstall_proglang 1))
  1867. ;    )
  1868.  
  1869.      ; Asm
  1870.      (if (OR #all (IN #uninstall_proglang 2))
  1871.        (
  1872.     (if #old_asm_i
  1873.       (
  1874.        (set #dest-dir "AINC:")
  1875.        (set #dir (tackon #dest-dir "Libraries"))
  1876.        (delete (tackon #dir (cat @app-name ".i")) (optional "force"))
  1877.        (set #dir (tackon #dest-dir "lvo"))
  1878.        (delete (tackon #dir (cat @app-name ".i")) (optional "force"))
  1879.       )
  1880.     )
  1881.        )
  1882.      )
  1883.  
  1884.      ; Amiga-E
  1885.      (if (OR #all (IN #uninstall_proglang 3))
  1886.        (
  1887.     (if #old_e_e
  1888.       (
  1889.        (set #dest-dir "EMODULES:")
  1890.        (set #dir (tackon #dest-dir "Libraries"))
  1891.        (delete (tackon #dir (cat @app-name ".e")) (optional "force"))
  1892.        (set #dir (tackon #dest-dir ""))
  1893.        (delete (tackon #dir (cat @app-name "_pragmas.m")) (optional "force"))
  1894.       )
  1895.     )
  1896.        )
  1897.      )
  1898.  
  1899.      ; Modula-II
  1900.      (if (OR #all (IN #uninstall_proglang 4))
  1901.        (
  1902.     (set #dest-dir "M2:")
  1903.     (set #dir (tackon #dest-dir "Defs"))
  1904.     (if #old_modula_def
  1905.       (delete (tackon #dir (cat @app-name "D.def")) (optional "force"))
  1906.     )
  1907.     (if #old_modula_mod
  1908.       (delete (tackon #dir (cat @app-name "L.def")) (optional "force"))
  1909.     )
  1910.        )
  1911.      )
  1912.  
  1913.      ; Oberon
  1914.      (if (OR #all (IN #uninstall_proglang 5))
  1915.        (
  1916.     (set #dest-dir "Oberon:")
  1917.     (if #old_oberon_mod
  1918.       (
  1919.        (set #dir (tackon #dest-dir "Interfaces"))
  1920.        (delete (tackon #dir (cat @app-name ".mod")) (optional "force"))
  1921.       )
  1922.     )
  1923.        )
  1924.      )
  1925.  
  1926.      ; ARexx
  1927.      (if (OR #all (IN #uninstall_proglang 6))
  1928.        (
  1929.     (set #dest-dir "Rexx:")
  1930.     (if #old_rexx
  1931.       (
  1932.        (set #dir (tackon #dest-dir ""))
  1933.        (delete (tackon #dir (cat @app-name ".rexx")) (optional "force"))
  1934.       )
  1935.     )
  1936.        )
  1937.      )
  1938.  
  1939.      ; Cluster
  1940.  ;   (if (OR #all (IN #uninstall_proglang 7))
  1941.  ;     (
  1942.  ;    (set #dest-dir "Cluster:")
  1943.  ;    (set #dir (tackon #dest-dir "txt"))
  1944.  ;    (if #old_cluster_def
  1945.  ;      (delete (tackon #dir (cat @app-name ".def")) (optional "force"))
  1946.  ;    )
  1947.  ;    (if #old_cluster_mod
  1948.  ;      (delete (tackon #dir (cat @app-name ".mod")) (optional "force"))
  1949.  ;    )
  1950.  ;     )
  1951.  ;   )
  1952.  
  1953.      ; Blitz Basic 2
  1954.  ; <name>Lib/Developer/BB2/Include/Libraries/<name>.asc     (optional)
  1955.  ; <name>Lib/Developer/BB2/blitzlibs/amigalibs/<name>.library1    (optional)
  1956.  ;   (if (OR #all (IN #uninstall_proglang 8))
  1957.  ;     (
  1958.  ;    (set #dest-dir "BLITZ2:")
  1959.  ;    (if #old_bb2
  1960.  ;      (
  1961.  ;       (set #dir (tackon #dest-dir "Include/Libraries"))
  1962.  ;       (delete (tackon #dir (cat @app-name ".asc")) (optional "force"))
  1963.  ;       (set #dir (tackon #dest-dir "blitzlibs/amigalibs"))
  1964.  ;       (delete (tackon #dir (cat @app-name ".library1")) (optional "force"))
  1965.  ;      )
  1966.  ;    )
  1967.  ;     )
  1968.  ;   )
  1969.     )
  1970.    )
  1971.  
  1972.   (P_CustomUninstall)
  1973.   (complete 100)
  1974.  )
  1975.  
  1976. ; -----------------------------------------------------------------------------
  1977.  
  1978.  ; Check OS
  1979.  (P_GetOSVersion)
  1980.  (set #ver2 #min_os_version)
  1981.  (set #rev2 #min_os_revision)
  1982.  (P_CompareVersions)
  1983.  (if (= #result -1)
  1984.    (
  1985.     (set #ver #min_os_version)
  1986.     (set #rev #min_os_revision)
  1987.     (P_GetOSVersionStr)
  1988.     (abort (#abort_oldos #str #os_str))
  1989.    )
  1990.  )
  1991.  
  1992.  ; Check if there is an already installed version?
  1993.  (if (= (fileonly (pathonly @icon)) "Install")
  1994.    (set #src-dir "/")
  1995.    (set #src-dir "")
  1996.  )
  1997.  (set #dest-dir @default-dest)
  1998.  (set #dir #dest-dir)
  1999.  (P_CheckInstalled)
  2000.  ; (P_CustomExists)
  2001.  
  2002.  (set #dir #src-dir)
  2003.  (P_CheckExists)
  2004.  
  2005.  ; Check old version
  2006.  (set #file (tackon "Libs:" (cat @app-name ".library")))
  2007.  (P_GetVersion)
  2008.  (set #ver2 #ver)
  2009.  (set #rev2 #rev)
  2010.  
  2011.  ; Check archiv
  2012.  (set #i 0)
  2013.  (set #file "")
  2014.  (while (AND (< #i 10) (= (strlen #file) 0))
  2015.    (
  2016.     (if (exists (tackon (tackon #src-dir "libs") (cat @app-name (select #i "" "000" "010" "020" "020f" "030" "030f" "040" "040f" "060") ".library")) (noreq))
  2017.       (set #file (tackon (tackon #src-dir "libs") (cat @app-name (select #i "" "000" "010" "020" "020f" "030" "030f" "040" "040f" "060") ".library")))
  2018.     )
  2019.     (set #i (+ #i 1))
  2020.    )
  2021.  )
  2022.  (P_GetVersion)
  2023.  
  2024.  (P_CompareVersions)
  2025.  (if (= #result -1)
  2026.    (abort (#abort_oldversion #ver2 #rev2 #ver #rev))
  2027.    (if (= #result 0)
  2028.      (if (= #ver 0)
  2029.        (set #update 0)
  2030.        (set #update 1)
  2031.      )
  2032.      (set #update 0)
  2033.    )
  2034.  )
  2035.  
  2036.  ; Install over old/Update existing
  2037.  (select (if #old_lib
  2038.        (askchoice (prompt #prompt_install_uninstall)
  2039.               (help #help_askchoice @askchoice-help)
  2040.               (default 0)
  2041.               (choices
  2042.             (cat #prop
  2043.                  (if (= #update 0)
  2044.                 #choice_install
  2045.                 #choice_update
  2046.                  )
  2047.             )
  2048.             #choice_uninstall
  2049.               )
  2050.        )
  2051.        (
  2052.         (message #prompt_info)
  2053.         0
  2054.        )
  2055.      )
  2056.    ( ; Install
  2057.     (welcome #welcome_install)
  2058.     (P_Install)
  2059.    )
  2060.    ( ; Uninstall
  2061.     (set @abort-button #button_abort)
  2062.     (welcome #welcome_uninstall)
  2063.     (P_Uninstall)
  2064.     (exit #exit_uninstall_finished (quiet))
  2065.    )
  2066.  )
  2067.